<template>
    <div class="">
      {{ $route.query.name }}
      <p>{{ params.age }}</p>
      <button @click="toCild">去子页面</button>
      <DemoComp :data="'子页面传的值:0'"></DemoComp>
      <NuxtPage></NuxtPage>
    </div>
  </template>
  
  <script setup>
  import { reactive, onMounted } from 'vue'
  const route = useRoute()
  const params = reactive({
    age: route.query.age
  })
  onMounted(() => {
    console.log(route.query)
    // params.age = route.query.age
  })
  async function toCild() {
    await navigateTo({
        path: '/home/child'
    })
  }
  </script>
  
  <style scoped></style>